﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace ST.Buz.Base.Entity
{
	/// <summary>
	/// 用户会话
	/// </summary>
	[Table("Sys_Session")]
	public partial class Sys_Session
	{
		/// <summary>
		/// ID
		/// </summary>
		[Key]
		[Column("ID")]
		public int ID { get; set; }

		/// <summary>
		/// 用户ID
		/// </summary>
		[Column("UserID")]
		public int UserID { get; set; }

		/// <summary>
		/// 用户登录类型
		/// </summary>
		[Column("Type")]
		public int Type { get; set; }

		/// <summary>
		/// Session Key（如果是电脑端的话，可以使用IP生成）
		/// </summary>
		[Column("SessionKey")]
		[StringLength(200, ErrorMessage = "{0}长度不能超过{1}")]
		public string SessionKey { get; set; }

		/// <summary>
		/// 关联的公众号授权ID
		/// </summary>
		[Column("RelatedOAuthID")]
		public int RelatedOAuthID { get; set; }

		/// <summary>
		/// 生成时间
		/// </summary>
		[Column("AddTime")]
		public DateTime AddTime { get; set; }

		/// <summary>
		/// 最后访问时间
		/// </summary>
		[Column("LastVisit")]
		public DateTime LastVisit { get; set; }

		/// <summary>
		/// 最后访问IP
		/// </summary>
		[Column("LastVisitIP")]
		[StringLength(40, ErrorMessage = "{0}长度不能超过{1}")]
		public string LastVisitIP { get; set; }

		/// <summary>
		/// 最后更新时间
		/// </summary>
		[Column("LastUpdate")]
		public DateTime LastUpdate { get; set; }
	}
}
